/*
 * @FilePath: \undefinedc:\Users\sxjct\.leetcode\263.丑数.cpp
 * @Brief: 
 * @Version: 1.0
 * @Date: 2021-04-12 16:29:57
 * @Author: tianyiyi
 * @Copyright: Copyright@tianyiyi
 * @LastEditors: Mr.Tian
 * @LastEditTime: 2021-04-12 16:32:51
 */
/*
 * @lc app=leetcode.cn id=263 lang=cpp
 *
 * [263] 丑数
 */

// @lc code=start
class Solution {
public:
    bool isUgly(int n) {
        if(n == 1)
            return true;
        if(n == 0)
            return false;
        if(n % 2 == 0)
            return isUgly(n/2);
        if(n % 3 == 0)
            return isUgly(n/3);
        if(n % 5 == 0)
            return isUgly(n/5);
    }
};
// @lc code=end

